package com.beiyou.dto;

import com.beiyou.dto.enums.EnumGoodsStatus;
import com.beiyou.dto.enums.EnumProductStatus;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * @author wzby
 * @Date: 2022/10/25 20:16
 */
@Data
public class ProductDto {

    private Integer id;

    private String name;

    private String img;

    private Integer goodsId;

    private BigDecimal price;

    private String brief;

    private Integer status;

    private Integer seq;

    private String lastUpdateBy;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private LocalDateTime lastUpdateTime = LocalDateTime.now();

    private String statusX;

    public String getStatusX(){
        EnumProductStatus byCode = EnumProductStatus.findByCode(this.status);
        return byCode.getName();
    }
}
